package com.xiaoma.registrar;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author maj
 * @ClassName MySpringboot
 * @Description
 * @date 2020-09-26 16:51
 */

/**
 * @MyServiceScan要和@configuration一起使用，所以@MyServiceScan在该处是不生效的
 * 除非加@Configuration
 * MySpringboot
 */
@MyServiceScan(basePackage = "com.xiaoma.registrar")
public class MySpringboot {

  public static void main(String[] args) {

   ApplicationContext context = new AnnotationConfigApplicationContext(MySpringboot.class);
    String[] beanDefinitionNames = context.getBeanDefinitionNames();
    for (int i = 0; i < beanDefinitionNames.length; i++) {
      System.out.println(beanDefinitionNames[i]);
    }


  }

}
